<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class MC_Parser_Def</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class MC_Parser_Def</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
							<a href="#sec-descendents">Descendents</a>
			|											<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The root class of all instances generated by MC_Parser when defining a grammar</p>
	<ul class="tags">
				<li><span class="field">abstract:</span> </li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Parser---Def.php.html">/Parser/Def.php</a> (line <span class="field">29</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>

	<a name="sec-descendents"></a>
	<div class="info-box">
		<div class="info-box-title">Direct descendents</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
			<span class="disabled">Descendents</span>
			|												<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
								|															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<table cellpadding="2" cellspacing="0" class="class-table">
				<tr>
					<th class="class-table-header">Class</th>
					<th class="class-table-header">Description</th>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../MC_Parser/MC_Parser_Def_Regex.html">MC_Parser_Def_Regex</a></td>
					<td>
											Generic grammar rule for matching a regular expresion
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../MC_Parser/MC_Parser_Def_NOrMore.html">MC_Parser_Def_NOrMore</a></td>
					<td>
											Parser Generator for PHP
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../MC_Parser/MC_Parser_Def_Literal.html">MC_Parser_Def_Literal</a></td>
					<td>
											Parser Generator for PHP
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../MC_Parser/MC_Parser_Def_Empty.html">MC_Parser_Def_Empty</a></td>
					<td>
											This match always succeeds with a zero-length suppressed token - useful for doing any kind of optional matching
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../MC_Parser/MC_Parser_Def_Set.html">MC_Parser_Def_Set</a></td>
					<td>
											Verify that the string matches a series of subexpressions in the specified order
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../MC_Parser/MC_Parser_Def_Recursive.html">MC_Parser_Def_Recursive</a></td>
					<td>
											Parser Generator for PHP
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em"><a href="../MC_Parser/MC_Parser_Def_OneOf.html">MC_Parser_Def_OneOf</a></td>
					<td>
											Successfully match one of a set of potential expressions - the longest match wins if there are multiples
										</td>
				</tr>
							</table>
		</div>
	</div>


	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$name" title="details" class="var-name">$name</a>
				</div>
																<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$suppress" title="details" class="var-name">$suppress</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																												
												<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#getName" title="details" class="method-name">getName</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../MC_Parser/MC_Parser_Def.html">MC_Parser_Def</a></span>
										<a href="#name" title="details" class="method-name">name</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../MC_Parser/MC_Parser_Token.html">MC_Parser_Token</a></span>
										<a href="#parse" title="details" class="method-name">parse</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#parsePart" title="details" class="method-name">parsePart</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$loc</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#suppress" title="details" class="method-name">suppress</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../MC_Parser/MC_Parser_Token.html">MC_Parser_Token</a>|null</span>
										<a href="#token" title="details" class="method-name">token</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$value</span>)
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../MC_Parser/MC_Parser_Token_Group.html">MC_Parser_Token_Group</a></span>
										<a href="#tokenGroup" title="details" class="method-name">tokenGroup</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#_name" title="details" class="method-name">_name</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#_parse" title="details" class="method-name">_parse</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$loc</span>)
									</div>
								</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$name" id="$name"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$name</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">31</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$suppress" id="$suppress"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$suppress</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">32</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
			<hr class="separator" />
		<div class="notes">Redefined in descendants as:</div>
		<ul class="redefinitions">
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Empty.html#var$suppress">MC_Parser_Def_Empty::$suppress</a>
							</li>
				</ul>
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-descendents">Descendents</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="methodgetName" id="getName"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getName</span> (line <span class="line-number">84</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return the user-provided name, if given, or the generated one otherwise</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getName
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodname" id="name"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">name</span> (line <span class="line-number">94</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Give this grammar def a name in the results</p>
	<ul class="tags">
				<li><span class="field">return:</span> - chainable method</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../MC_Parser/MC_Parser_Def.html">MC_Parser_Def</a></span>
		<span class="method-name">
			name
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span>			</li>
				</ul>
		
			
	</div>
<a name="methodparse" id="parse"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">parse</span> (line <span class="line-number">39</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Parse a string, and return the result or throw a parser exception</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../MC_Parser/MC_Parser_Token.html">MC_Parser_Token</a></span>
		<span class="method-name">
			parse
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$str</span>			</li>
				</ul>
		
			
	</div>
<a name="methodparsePart" id="parsePart"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">parsePart</span> (line <span class="line-number">55</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Parse a string, cleaning up whitespace when we're done</p>
	<ul class="tags">
				<li><span class="field">return:</span> A two-item array of the string location where parsing stopped, and the MC_Token instance that matches the grammar conditions</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			parsePart
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$loc</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$str</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$loc</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsuppress" id="suppress"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">suppress</span> (line <span class="line-number">102</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Toggle suppressing the token from the results</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			suppress
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodtoken" id="token"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">token</span> (line <span class="line-number">111</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return a token instance, copying over this Def's name and flagging suppression</p>
	<ul class="tags">
				<li><span class="field">return:</span> the new token, or null if the token should be suppressed</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../MC_Parser/MC_Parser_Token.html">MC_Parser_Token</a>|null</span>
		<span class="method-name">
			token
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$value</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$value</span>			</li>
				</ul>
		
			
	</div>
<a name="methodtokenGroup" id="tokenGroup"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">tokenGroup</span> (line <span class="line-number">121</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return a token group (a token that can contain subtokens), copying over this Def's name</p>
<p class="description"><p>token groups cannot be suppressed</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../MC_Parser/MC_Parser_Token_Group.html">MC_Parser_Token_Group</a></span>
		<span class="method-name">
			tokenGroup
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method_name" id="_name"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_name</span> (line <span class="line-number">79</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Each definition type should have some way of giving itself a name if the user didn't provide one</p>
	<ul class="tags">
				<li><span class="field">abstract:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			_name
		</span>
				()
			</div>
	
		
			
			<hr class="separator" />
		<div class="notes">Redefined in descendants as:</div>
		<ul class="redefinitions">
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Regex.html#method_name">MC_Parser_Def_Regex::_name()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_NOrMore.html#method_name">MC_Parser_Def_NOrMore::_name()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Literal.html#method_name">MC_Parser_Def_Literal::_name()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Empty.html#method_name">MC_Parser_Def_Empty::_name()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Set.html#method_name">MC_Parser_Def_Set::_name()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Recursive.html#method_name">MC_Parser_Def_Recursive::_name()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_OneOf.html#method_name">MC_Parser_Def_OneOf::_name()</a>
							</li>
				</ul>
	</div>
<a name="method_parse" id="_parse"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_parse</span> (line <span class="line-number">73</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Each definition type should implement their own _parse() function that tests a string</p>
	<ul class="tags">
				<li><span class="field">return:</span> A two-item array of the string location where parsing stopped, and the MC_Token instance that matches the grammar conditions</li>
				<li><span class="field">abstract:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			_parse
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$str</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$loc</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$str</span><span class="var-description">: the string to parse</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$loc</span><span class="var-description">: the index to start parsing</span>			</li>
				</ul>
		
			
			<hr class="separator" />
		<div class="notes">Redefined in descendants as:</div>
		<ul class="redefinitions">
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Regex.html#method_parse">MC_Parser_Def_Regex::_parse()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_NOrMore.html#method_parse">MC_Parser_Def_NOrMore::_parse()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Literal.html#method_parse">MC_Parser_Def_Literal::_parse()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Empty.html#method_parse">MC_Parser_Def_Empty::_parse()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Set.html#method_parse">MC_Parser_Def_Set::_parse()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_Recursive.html#method_parse">MC_Parser_Def_Recursive::_parse()</a>
							</li>
					<li>
				<a href="../MC_Parser/MC_Parser_Def_OneOf.html#method_parse">MC_Parser_Def_OneOf::_parse()</a>
							</li>
				</ul>
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Wed, 13 May 2009 08:25:46 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
	</p>
	</div></body>
</html>